<div id="processTokenMainDiv">
	<div class="modal-body">
		<g:formRemote name="processToken" update="processTokenMainDiv"
			url="[controller: 'eventAlbumToken', action: 'processToken']">

			<g:if test="${flash.tokenError}">
				<div class="alert alert-error">
					<a class="close" data-dismiss="alert">×</a>
					${flash.tokenError}
				</div>
			</g:if>

			<p><g:message code="share.description" /></p>
			<br>

			<div id="tokenIdField" class="control-group input-append">
				<g:field id="inputToken" class="input-large" type="text"
					name="tokenId" value="" maxlength="200"
					placeholder="${message(code: 'share.albumsPassword')}" style="width: 380px;"/>

				<button class="btn btn-success">
					<i class="icon-plus-sign icon-white"></i>
				</button>
			</div>

		</g:formRemote>

		<script type="text/javascript">
			
			if ('${processTokenStatus}' == 'PROCESS_TOKEN_OK') {
				var eventId = '${eventId}'
				var successUrl = "${createLink(controller: 'event', action: 'show', id: eventId)}";
				window.location.replace(successUrl);
			} else if ('${processTokenStatus}' == 'PROCESS_TOKEN_FAILED') {
				// $('#tokenIdField').addClass('error');
			}
			
		</script>
	</div>
</div>